package com.lyd.mybatis.demo.app.model.dto;


import com.lyd.sweet.web.annotation.CreateValidated;
import com.lyd.sweet.web.annotation.UpdateValidated;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

@Data
@ApiModel(description = "角色dto", value = "RoleDTO")
public class RoleDTO {
    @ApiModelProperty(value = "角色主键", example = "1", required = true)
    @NotNull(groups = UpdateValidated.class)
    @Null(groups = CreateValidated.class)
    private Long roleId;

    @ApiModelProperty(value = "角色名称", example = "Admin", required = true)
    @NotNull(groups = {UpdateValidated.class, CreateValidated.class})
    private String roleName;

    @ApiModelProperty(value = "角色编码", example = "10001", required = true)
    @NotNull(groups = {UpdateValidated.class, CreateValidated.class})
    private String roleCode;
}
